package com.yjz.jvm.juc.线程.线程算法题1.我的实现;

public class Decrease implements Runnable {

    private Target t;

    public Decrease(Target t) {
        this.t = t;
    }

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            try {
                Thread.sleep((long) Math.random() * 500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            t.deCrease();
        }
    }
}
